import service from '@/axios/index.js'

// 最新日报列表

export const getLatestDailyList = () => {
  return service.get('/stories/latest')

}

/*  历史日报列表
@param {string} date 日期，格式为YYYYMMDD
*/
export const getHistoryDailyList = (date) => {
  return service.get(`/stories/before/${date}`)
}


/*日报内容
@param {string} id 日报ID
*/
export const getDailyContent = (id) => {
  return service.get(`/story/${id}`)
}


/*日报额外信息
@param {string} id 日报ID
*/
export const getDailyExtra = (id) => {
  return service.get(`/story/${id}/extra`)
}

/*短评
@param {string} id 日报ID
*/
export const getShortComments = (id) => {
  return service.get(`/story/${id}/short-comments`)
}

/* 更多短评
@param {string} storyId 日报ID
@param {string} commonId 评论ID
*/
export const getMoreShortComments = (storyId, commonId) => {
  return service.get(`/story/${storyId}/short-comments/before/${commonId}`)
}


/* 长评
@param {string} id 日报ID
*/
export const getLongComments = (id) => {
  return service.get(`/story/${id}/long-comments`)
}

/* 更多长评
@param {string} storyId 日报ID
@param {string} commonId 评论ID
*/
export const getMoreLongComments = (storyId, commonId) => {
  return service.get(`/story/${storyId}/long-comments/before/${commonId}`)
}

/* 合集日报列表
@param {string} id 合集ID
*/
export const getCollectionDailyList = (id) => {
  return service.get(`/section/${id}`)
}

/* 方程式转SVG图
@param {string} tex 数学方程式
*/
export const getMathSvg = (tex) => {
  return service.get(`/equation?tex=${tex}`)
}
